package demo.anno;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target(ElementType.METHOD)  // 限定下面自定义的注解只能写在修饰方法
@Retention(RetentionPolicy.RUNTIME)
@interface Test {

}

public class Foo {
    @Test
    public static void m1() { }

    public static void m2() { }

    @Test
    public static void m3() {
        throw new RuntimeException("Boom");
    }

    public static void m4() { }

    @Test
    public static void m5() { }

    public static void m6() { }

    @Test
    public static void m7() {
        throw new RuntimeException("Crash");
    }

    public static void m8() { }
}

